#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
typedef long long LL;

int n;
LL arr[N];

int main(){
    scanf("%d", &n);
    for (int i = 0; i < n; i++){
        scanf("%d", &arr[i]);
    }
    LL pos=0,neg=0;
    for (int i = 1; i < n; i++){
        if (arr[i] - arr[i-1]>0)
            pos += arr[i]-arr[i-1];
        else
            neg += arr[i-1]-arr[i];
    }
    printf("%lld\n", max(neg, pos));
    printf("%lld", abs(neg-pos) + 1);
    return 0;
}
